//
//  returnMoney.m
//  jiaKaoZhuShou
//
//  Created by 金艺社 on 2018/5/22.
//  Copyright © 2018年 金艺社. All rights reserved.
//

#import "returnMoney.h"
#import "reimbursementV.h"
#import "confirmView.h"
@interface returnMoney ()

@end

@implementation returnMoney

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"还款";
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    reimbursementV *View = [[NSBundle mainBundle] loadNibNamed:@"reimbursementV"owner:self options:nil].firstObject;
    View.money_lab.text = self.money;
    View.gray_lab.text = [NSString stringWithFormat:@"还款%@元", _money];
    [self.view addSubview:View];
    
    [View mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@2);
        make.left.right.equalTo(self.view);
        make.height.equalTo(@116);
    }];
    
    UIButton *bottomView = [UIButton new];
    [self.view addSubview:bottomView];
    bottomView.backgroundColor = [UIColor custom_color:@"#A91E23"];
    bottomView.layer.masksToBounds = YES;
    bottomView.layer.cornerRadius = 22;
    [bottomView setTitle:@"确认还款" forState:0];
    [bottomView setTitleColor:[UIColor whiteColor] forState:0];
    [bottomView addTarget:self action:@selector(Repaymentclick) forControlEvents:UIControlEventTouchUpInside];
    [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(20);
        make.right.equalTo(self.view).offset(-20);
        make.top.equalTo(View.mas_bottom).offset(20);
        make.height.equalTo(@45);
    }];
}
-(void)Repaymentclick {
    confirmView *View = [[NSBundle mainBundle] loadNibNamed:@"confirmView"owner:self options:nil].firstObject;
    View.ID = self.ID;
    View.payMoney = self.money;
    View.payType = @"2";
    View.money_lab.text = [NSString stringWithFormat:@"%.2f", self.money.doubleValue];
    View.order_lab.text = self.oid;
    View.ordType = self.orderType;
    [helpPublic getCurrentViewController:self].definesPresentationContext = YES;
    UIViewController *vc = [[UIViewController alloc]init];
    vc.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.4];
    vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [vc.view addSubview:View];
    [View mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(@0);
        make.height.equalTo(@343);
    }];
    [self.view.window.rootViewController presentViewController:vc animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
